<div class="list">
	<table>
		<thead>
			<tr>
				<g:sortableColumn property="authority" title="${message(code: 'agentPerson.id.label', default: 'Group Role')}" />
				<th>Description</th>
				<g:sortableColumn property="rolesCount" title="${message(code: 'agentPerson.id.label', default: '# Accounts')}" />
			</tr>
		</thead>
		<tbody>
			<g:each in="${roles}" status="i" var="role">
				<tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
		     		<td width="80px">
						${role.label}
		     		</td>
		     		<td>
		     			${role.description}
		     		</td>
		     		<td width="80px">
		     			<g:each in="${rolesCount}" var="roleCount">
		     				<g:if test="${roleCount.key == role.id}">
		     					${roleCount.value}
		     					<g:if test="${roleCount.value>0}">
			     					<g:link controller="users" action="listRoleUsers" id="${role.id}">
			     						Browse Accounts
			     					</g:link>
		     					</g:if>
		     				</g:if>
		     			</g:each>
		     		</td>
		     	</tr>
			</g:each>
		</tbody>
	</table>
	<div class="paginateButtons">
   		<g:paginate total="${rolesTotal}" />
	</div>
</div>